package com.gzc.pm.enums;

public enum TestItemModuleType {
	
	H("心盘面高度", "h", 0),
	KS("抗剪刚度", "ks", 1),
	M("回转阻力矩", "m", 2),
	PCK("心盘载荷", "pck", 3),
	PPTS("旁承载荷、压缩量、间隙", "ppts", 4);
	
	private TestItemModuleType(String n, String t, int v){
		this.name = n;
		this.type = t;
		this.value = v;
	}
	
	private String name;
	private String type;
	private int value;
	
	public static String getNameByValue(int v){
		String n = "";
		switch(v){
			case 0:
				n = H.name;
				break;
			case 1:
				n = KS.name;
				break;
			case 2:
				n = M.name;
				break;
			case 3:
				n = PCK.name;
				break;
			case 4:
				n = PPTS.name;
				break;
		}
		return n;
	}
	
	public static int getValueByName(String n){
		int v = -1;
		if(H.name.equals(n)){
			v= H.value;
		}else if(KS.name.equals(n)){
			v= KS.value;
		}else if(M.name.equals(n)){
			v= M.value;
		}else if(PCK.name.equals(n)){
			v= PCK.value;
		}else if(PPTS.name.equals(n)){
			v= PPTS.value;
		}
		return v;
	}
}
